//
//  HttpRequest.swift
//  zpzk_shop
//
//  Created by Qingke on 16/5/19.
//  Copyright © 2016年 Qingke. All rights reserved.
//

import Foundation
import Alamofire

class HttpManager {
    static func httpGetRequest(method: Alamofire.Method,url: String,params: [String: AnyObject],onSucess: (sucessDate: AnyObject) ->Void,onFailed: (failedDate: AnyObject) ->Void){
        
        Alamofire.request(method, url, parameters: params).responseJSON { re in
            if let JSON = re.result.value where re.result.isSuccess {
                onSucess(sucessDate: JSON)
            }else {
                onFailed(failedDate: "error Failed")
            }
        }
    }
    
}
